<?php
/**
 * Yii command line script file.
 *
 * This script is meant to be run on command line to execute
 * one of the pre-defined console commands.
 *
 * @author anxu <anxu1212@hotmail.com>
 */

// fix for fcgi
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));

defined('YII_DEBUG') or define('YII_DEBUG', true);


require __DIR__ . '/../vendor/autoload.php';

$config = app\helpers\ArrayHelper::merge(
    require __DIR__ . '/config/console.php',
    require __DIR__ . '/config/console-local.php'
);

$app = Yii::createConsoleApplication($config);

$app->commandRunner->addCommands(YII_PATH . '/cli/commands');
$env = @getenv('YII_CONSOLE_COMMANDS');
if (!empty($env)) {
    $app->commandRunner->addCommands($env);
}

$app->run();






